Weak order of permutations